package com.fsnbigdata.service.api;
import com.fsnbigdata.domain.Distribution;
import org.springframework.roo.addon.layers.service.annotations.RooService;
import com.fsnbigdata.domain.Organism;
import io.springlets.data.domain.GlobalSearch;
import io.springlets.format.EntityResolver;

import java.math.BigInteger;
import java.util.List;
import java.util.Set;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * = DistributionService
 *
 * TODO Auto-generated class documentation
 *
 */
@RooService(entity = Distribution.class)
public interface DistributionService extends EntityResolver<Distribution, Long> {

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return Distribution
     */
    public abstract Distribution findOne(Long id);

    /**
     * TODO Auto-generated method documentation
     *
     * @param entity
     * @return Distribution
     */
    public abstract Distribution save(Distribution entity);

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return Distribution
     */
    public abstract Distribution findOneForUpdate(Long id);

    /**
     * TODO Auto-generated method documentation
     *
     * @param ids
     * @return List
     */
    public abstract List<Distribution> findAll(Iterable<Long> ids);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param globalSearch
     * @param pageable
     * @return Page
     */
    public abstract Page<Distribution> findByOrganism(Organism organism, GlobalSearch globalSearch, Pageable pageable);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @return Long
     */
    public abstract long countByOrganism(Organism organism);
    
    /**
     * TODO Auto-generated method documentation
     * @param province
     * @return
     */
    public abstract List<String> findAllByProvince(String province);
    
//    public abstract List<Distribution> findAllByCityLike(String city);
    
    public abstract List<Long> findByCityAndCounty(String city,String county);

    public abstract List<BigInteger> geOrganismIdPronvince();

    List<String> query1(Distribution distribution);

    List<String> query2(Distribution distribution);

    List<Long> query3(Distribution distribution);
}
